/**
 * Copyright © 2011 looty - Textoo
 * @link http://www.textoo.org
 * @link http://code.google.com/p/textoo/
 * @author lab9 - Bertrand Larrieu
 * @mail lab9.fr@gmail.com
 * @version 2.0
 */

package org.looty.textoo.font 
{
	import flash.display.*;
	import flash.errors.*;
	import flash.text.*;
	import org.looty.log.*;
	
	public class FontExporter extends Sprite
	{
		
		public function FontExporter() 
		{
			
		}
		
		protected function registerFont(font:Class):void
		{
			if (!(font is Font)) throw new IllegalOperationError("font has to be a Font class");
			Font.registerFont(font);
			
			var instance:Font = new font() as Font;
			if (instance.fontType == FontType.EMBEDDED_CFF) 
			{
				var msg:String = "font is emmbededAsCFF and is not compatible with TextField. Please set embedAsCFF='false' in your embed";
				Looger.fatal(msg);
				throw new IllegalOperationError(msg);
			}
			
			Looger.info("1:registerFont ", instance.fontName, " - fontStyle ", instance.fontStyle); 
		}
		
	}

}